﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
///Helper 的摘要说明
/// </summary>
public class Helper
{
    public Helper()
    {

    }

    public static bool HasLogin()
    {
        if (HttpContext.Current.Session == null) { return false; }
        string username = (string)HttpContext.Current.Session["Username"];
        return !string.IsNullOrEmpty(username);
    }

    public static void Login(string username)
    {
        HttpContext.Current.Session["Username"] = username;
    }

    public static void Logout()
    {
        HttpContext.Current.Session.Remove("Username");
    }
}